<template>
	<view class="not-data" :style="{
		color:color
	}">
		<!-- 默认为空展示 -->
		<view class="item type-1" v-if="ndType == 1" >
			<view class="item-image">
				<image class="" src="/static/nodata.png" mode=""></image>
			</view>
			<view class="text">
				{{ndText}}
			</view>
		</view>
		<!-- 搜索 -->
		<view class="item type-1" v-if="ndType == 2">
			<image class="item-image" src="/static/nodata.png" mode=""></image>
			<view class="text">
				搜索没有结果～
			</view>
		</view>
		<!-- 购物车 -->
		<view class="item type-2" v-if="ndType == 3">
			<image class="item-image" src="/static/nodata.png" mode=""></image>
			<view class="text">
				您的购物车空空如也～
			</view>
		</view>
		<!-- 收货地址 -->
		<view class="item type-3" v-if="ndType == 4">
			<text class="iconfont">&#xe605;</text>
			<view class="text">
				{{ndText}}
			</view>
		</view>
		<!-- 收藏 -->
		<view class="item type-5" v-if="ndType == 5">
			<image class="item-image" src="/static/nodata.png" mode=""></image>
			<view class="text">
				{{ndText}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			ndType:{//为空展示类型 1:默认为空 2:搜索结果为空 3:购物车为空
				type:[Number,String],
				default(){
					return 1
				}
			},
			ndText:{//提示文本内容
				type:String,
				default(){
					return '暂无数据'
				}
			},
			color:{//字体颜色
				type:String,
				default(){
					return '#6E7A7C'
				}
			}
		},
		data(){
			return {
				
			}
		}
	}
</script>

<style scoped lang="scss">
	.not-data{
		// padding: 100rpx 0 100rpx;
		// text-align: center;
		// flex-direction: column;
		// align-items: center;
		margin-top: 150rpx;
		.item-image{
			width: 430rpx;
			height: 400rpx;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.text{
			font-size:32rpx;
			font-family:PingFang SC;
			font-weight:400;
			// color:rgba(110,122,124,1)
		}
		.type-1 {
			display: flex;
			flex-direction: column;
			align-items: center;
			
			.item-image{
				// flex-shrink: 0;
				width: 430rpx;
				height: 400rpx;
				image{
					width: 100%;
					height: 100%;
				}
			}
		}
		.type-3{
			.iconfont{
				font-size: 320rpx;
			}
		}
	}
</style>
